package com.gaber.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author gaber
 * @date 2023/8/3 14:52:56
 * @description TODO
 */
@RestController
@RequestMapping("/books")
public class BookController {

    @Value("${lesson}")
    private String lesson;

    @Value("${likes[0]}")
    private String like0;

    @GetMapping("/{id}")
    public String getById(@PathVariable Integer id) {
        System.out.println("id===>" + id);
        System.out.println(lesson + like0);
        return "hello, spring boot";
    }
}
